<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" session="false" %>
	<%@include file="/common/common.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- 
  - Author(s): zengjunjie
  - Date: 2018-07-02 17:29:00
  - Description:
-->
<head>
<title>Title</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    
    <style type="text/css">
    	#main-left{
    		border: 1px solid #999;
    		border-left:0px solid;
    		float: left;
    		height: 500px;
    		width: 15%;
    		background-color: #fafafa;
    	}
    	#main-right{
    		border: 1px solid #999;
    		float: right;
    		height: 500px;
    		width: 83%;
    		background-color: #fafafa;
    	}
    	.left-content{
    		width: 100%;
    		height: 40px;
    		cursor: pointer;
    	}
    	.left-content span{
    		line-height: 40px;
    		padding: 10px 15px;
    		cursor: pointer;
    		background-color: 
    	}
    	
    </style>
</head>
<body>
<div style="padding: 5px;float: left;width: 100%;">
	<div id="main-left">
	
	</div>
	
	
	<div id="main-right">
		<iframe id="mainframe" src="" frameborder="0" name="main" style="width:100%;height:100%;padding: 10px"></iframe>
	</div>
</div>
	

	<script type="text/javascript">
    	
    	var hidden="";
    	
    	
    	$(function(){
    		selectTreeNode();
    		
    		//点击时改变当前点击的背景色
    		$(".left-content").click(function(){
    			$(".left-content").css("background-color","#fafafa");
    			$(this).css("background-color","#E9E9E4");
    			//把当前选中的值传进全局变量 hidde
    			hidden=$(this).attr("data");
    			
    			var url="<%=request.getContextPath()%>/coframe/framework/menu/meun_icon.jsp?id="+hidden;
    			$("#mainframe").attr("src",url);
    			
    		});
    		
    	})
    	
    	
    	//查询菜单数据
    	function selectTreeNode(){
    		var json={
    			status:'true'
    		}
    		$.ajax({
				url: "org.gocom.components.coframe.auth.LoginManager.getMenuData.biz.ext",
				type: "POST",
				data:json,
				async:false,
				success: function(data){
					//循环拼接菜单
					for(var i=0;i<data.treeNodes.length;i++){
						$("#main-left").append('<div class="left-content" data="'+data.treeNodes[i].menuCode+'"><span id="'+data.treeNodes[i].menuCode+'" >'+data.treeNodes[i].menuName+'</span></div>');
					}
				}
			});
    	} 
    	
    	
    	
    </script>
</body>
</html>